package cn.cjlmonster.demo02;

import android.app.Application;
import android.content.res.Configuration;

import cn.cjlmonster.demo02.utils.LanguageUtils;

/**
 * This project is Demo02
 * Created by cjl on 2021/11/20 4:48 下午.
 */

public class MyApplication extends Application {

    private static MyApplication instance;

    public static MyApplication getInstance() {
        return instance;
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        LanguageUtils.changeLanguage(this, true);
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        LanguageUtils.changeLanguage(this, false);
    }
}
